
package com.oahc.magicdefender.screen;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input;
import com.badlogic.gdx.Screen;
import com.oahc.magicdefender.MainGame;

public abstract class AbstractScreen implements Screen {

    private MainGame game;

    public AbstractScreen(MainGame game) {
        this.game = game;
    }

    public MainGame getMainGame() {
        return game;
    }

    private boolean backHasTouched = false;

    @Override
    public void render(float delta) {
        // TODO Auto-generated method stub
        if (!backHasTouched && Gdx.input.isKeyPressed(Input.Keys.BACK)) {
            backHasTouched = true;
            onBackPressed();
        }
    }

    public abstract void onBackPressed();
}
